<%
''自定义数组
''使用两个数组模拟 Key => Value
class cls_array
''
Public key(),value()
Private count
Private qkey,qvalue
''
private sub class_initialize()
	count=-1
	qkey=""
	qvalue=""
end sub

private sub class_terminate()
	
end sub

''长度
public property get length
	length = count
end property

''增加
public sub add(byval keys, byval values)
	count = count + 1
	redim Preserve key(count)
	redim Preserve value(count)
	key(count) = keys
	value(count) = values
end sub

'通过key寻找value
public function getByKey(byval keys)
	dim idx
	if qkey = keys then getByKey = qvalue
	for idx=0 to count
		if key(idx) = keys then getByKey = value(idx) 
	next
end function

''判断是否有key,如果有就记下来
public function isHaveKey(byval keys)
	dim idx
	isHaveKey = false
	for idx=0 to count
		if key(idx) = keys then
			qkey = keys ''记住当前查询
			qvalue = value(idx)
			isHaveKey = true
			exit function
		end if
	next
end function

''删除所有
public sub removeall()
	count=-1
	redim key(0)
	redim value(0)
end sub

''
end class
%>